#include <iostream>
#include "BallShootingControl.h"
#include "WPILib.h"

BallShootingControl::BallShootingControl() {
	// Use requires() here to declare subsystem dependencies
	Requires(flyWheels);
}

// Called just before this Command runs the first time
void BallShootingControl::Initialize() {
}

// Called repeatedly when this Command is scheduled to run
void BallShootingControl::Execute() {
	if(oi->isShootingBalls())
	{
		cout << "Stop shooting" << endl;
		ssb = new StopShootingBalls();
		oi->setShootingStatus(false);
		ssb->Start();
				
	}
	else {
		cout << "Start shooting" << endl;
		stb = new ShootTheBalls();
		oi->setShootingStatus(true);
		stb->Start();
	}
}

// Make this return true when this Command no longer needs to run execute()
bool BallShootingControl::IsFinished() {
	return true;
}

// Called once after isFinished returns true
void BallShootingControl::End() {
}

// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void BallShootingControl::Interrupted() {
}
